/**
 * Generate time : 2011-07-08 17:18:46
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cm.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCMBasicset
 * 
 */
public class ZMCMBasicset extends DaoEPBase {

	private String fdKeyId = " "; /* 主键 */
	private Long fdAutotransferDate = new Long(0); /* 自动结转日期 */
	private Long fdUse2levelbase = new Long(0); /* 是否使用二级库 */
	private String fdPlanApproveDeparment = " "; /* 需求计划审批单位 */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("主键");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdAutotransferDate");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("自动结转日期");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdUse2levelbase");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("是否使用二级库");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdPlanApproveDeparment");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("需求计划审批单位");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCMBasicset() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - 主键
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - 主键
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdAutotransferDate - 自动结转日期
	 * 
	 * @return the fdAutotransferDate
	 */
	public Long getFdAutotransferDate() {
		return this.fdAutotransferDate;
	}

	/**
	 * set the fdAutotransferDate - 自动结转日期
	 */
	public void setFdAutotransferDate(Long fdAutotransferDate) {
		this.fdAutotransferDate = fdAutotransferDate;
	}

	/**
	 * get the fdUse2levelbase - 是否使用二级库
	 * 
	 * @return the fdUse2levelbase
	 */
	public Long getFdUse2levelbase() {
		return this.fdUse2levelbase;
	}

	/**
	 * set the fdUse2levelbase - 是否使用二级库
	 */
	public void setFdUse2levelbase(Long fdUse2levelbase) {
		this.fdUse2levelbase = fdUse2levelbase;
	}

	/**
	 * get the fdPlanApproveDeparment - 需求计划审批单位
	 * 
	 * @return the fdPlanApproveDeparment
	 */
	public String getFdPlanApproveDeparment() {
		return this.fdPlanApproveDeparment;
	}

	/**
	 * set the fdPlanApproveDeparment - 需求计划审批单位
	 */
	public void setFdPlanApproveDeparment(String fdPlanApproveDeparment) {
		this.fdPlanApproveDeparment = fdPlanApproveDeparment;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdAutotransferDate(NumberUtils.toLong(StringUtils.toString(map.get("fdAutotransferDate")), fdAutotransferDate));
		setFdUse2levelbase(NumberUtils.toLong(StringUtils.toString(map.get("fdUse2levelbase")), fdUse2levelbase));
		setFdPlanApproveDeparment(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdPlanApproveDeparment")), fdPlanApproveDeparment));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdAutotransferDate", StringUtils.toString(fdAutotransferDate, eiMetadata.getMeta("fdAutotransferDate")));
		map.put("fdUse2levelbase", StringUtils.toString(fdUse2levelbase, eiMetadata.getMeta("fdUse2levelbase")));
		map.put("fdPlanApproveDeparment", StringUtils.toString(fdPlanApproveDeparment, eiMetadata.getMeta("fdPlanApproveDeparment")));

		return map;

	}
}